{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "ff4b173d",
   "metadata": {},
   "source": [
    "---\n",
    "* 日期：2022-08-31\\week02（周三）\n",
    "* 课程：python\n",
    "* 记录人：zeng\n",
    "---\n",
    "\n",
    "# 本周学习内容\n",
    "\n",
    ">1. 安装配置python环境（anaconda，清华大学镜像）\n",
    ">>1. 什么是绝对路径和相对路径？\n",
    ">>2. 配置环境，相对路径有5个需要配置的，绝对路径根据自己的电脑进行配置\n",
    "\n",
    ">2. 回顾：GitHub desktop 如何实现本地与云端链接\n",
    ">>1. 克隆 gitee仓库的URL，到本地的指定文件路径，例如 D:2022-2023/python\n",
    ">>2. 上传 本地笔记到gitee仓库\n",
    "\n",
    ">3. 本周重点知识[Jupyter Notebook](http://localhost:8889/tree)\n",
    ">>1. 什么是IDE？（即集成开发环境）\n",
    ">>2. 如何打开Jupyter Notebook？\n",
    ">>>1. cmd\n",
    ">>>2. cd 指定目录下\n",
    ">>>3. 输入：Jupyter Notebook\n",
    "\n",
    ">4. 注：前九周全部使用Jupyter Notebook{IDE）来做课堂和课后练习\n",
    "\n",
    "## 2.模块（工具箱-不需要知道怎么做的，只需要会用）\n",
    ">1. 标准库（python团队自己开发出来的，如果有人用我的编程语言的话，常用的一些功能已经准备好了）\n",
    ">>1. 使用标准库的方法，import 模块名称\n",
    ">>2. [标准库的库](https://docs.python.org/3/library/index.html)\n",
    ">2. 开源模块(anaconda为例)\n",
    ">>1. [开源模块](https://pypl.org/)\n",
    ">3. 自定义模块"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "2bad5a82",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "hello world\n"
     ]
    }
   ],
   "source": [
    "print(\"hello world\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "4aab7299",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "time.struct_time(tm_year=2022, tm_mon=8, tm_mday=31, tm_hour=20, tm_min=8, tm_sec=33, tm_wday=2, tm_yday=243, tm_isdst=0)"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "time.localtime()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "1fd413d2",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "datetime.date(2022, 9, 3)"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "datetime. date.today()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "04c203e7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'2022-09-03'"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "datetime.date.isoformat(datetime.date.today())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "92cf19ef",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'16:31'"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import time\n",
    "time.strftime(\"%H:%M\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "2485163e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Saturday:PM'"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import time\n",
    "time.strftime(\"%A:%p\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c1ac25ed",
   "metadata": {},
   "outputs": [],
   "source": [
    "## 课本第四页 第一个项目"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "68e5a25f",
   "metadata": {},
   "outputs": [],
   "source": [
    "## 第一章共三个项目(知识点课堂讲)\n",
    "##项目课后写"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ea8432f5",
   "metadata": {},
   "source": [
    "# 课本实践"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "0582c029",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "30\n",
      "现在秒/时间为偶数\n",
      "等待时间为: 1\n",
      "31\n",
      "现在是秒/时间为奇数\n",
      "等待时间为: 2\n",
      "33\n",
      "现在是秒/时间为奇数\n",
      "等待时间为: 2\n",
      "35\n",
      "现在是秒/时间为奇数\n",
      "等待时间为: 1\n",
      "36\n",
      "现在秒/时间为偶数\n",
      "等待时间为: 1\n"
     ]
    }
   ],
   "source": [
    "import datetime\n",
    "import time,random\n",
    "\n",
    "odds = [  1, 3,  5,  7,  9, 11,13,15,17,19,\n",
    "             21,23,25,27,29,31,33,35,37,39,\n",
    "             41,43,45,47,49,51,53,55,57,59]\n",
    "\n",
    "# right_this_minute 是一个变量，是随着当前时间分钟数不断变化的一个值\n",
    "for i in range(5):\n",
    "    right_this_second = datetime.datetime.today().second\n",
    "    if right_this_second in odds:\n",
    "        print(right_this_second)\n",
    "        print(\"现在是秒/时间为奇数\")\n",
    "    else:\n",
    "        print(right_this_second)\n",
    "        print(\"现在秒/时间为偶数\")       \n",
    "    wait_time = random.randint(1,5)\n",
    "    print(\"等待时间为:\",wait_time) \n",
    "    time.sleep(wait_time)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c74d9323",
   "metadata": {},
   "outputs": [],
   "source": [
    "from datetime import datetime\n",
    "# right_this_minute = datetime.today().minute"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
